﻿@inject NavigationManager NavigationManager

<div class="demo-description">
    <h2><DemoNavLink Link="Upload#ChunkUpload" />Chunk Upload</h2>
    <p>This demo illustrates how to upload large files in chunks and process these chunks on the server. The <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxUpload.ChunkSize">ChunkSize</a> property specifies their size in bytes.</p>
</div>

<div class="card demo-card border-0">
    <div class="card-body">
        <DxUpload Name="myFile" UploadUrl="@GetUploadUrl("api/Upload/UploadChunkFile/")"
                  ChunkSize="200000" MaxFileSize="15000000">
        </DxUpload>
    </div>
</div>

<CodeSnippet_FileManagement_Upload_ChunkUploading></CodeSnippet_FileManagement_Upload_ChunkUploading>

@code {
    protected string GetUploadUrl(string url) {
        return NavigationManager.ToAbsoluteUri(url).AbsoluteUri;
    }
}
